// components/authorModal/authorModal.js
const app = getApp();

var common = require("../../common/common.js").common;

const defaultData = {
    authorIsShow: false
};

Component({
    /**
   * 组件的属性列表
   */
    properties: {
        userAuditStatus: {
            type: Number
        }
    },
    /**
   * 组件的初始数据
   */
    data: {
        ...defaultData
    },
    /**
   * 组件的方法列表
   */
    methods: {
        getUserInfo() {
            var that = this;
            common.getUserInfoNew({
                success(res) {
                    console.log(res);
                    that.setData({
                        authorIsShow: false
                    });
                    var myEventDetail = {
                        user: res
                    };
                    var myEventOption = {};
                    // 触发事件的选项
                                        that.triggerEvent("myevent", myEventDetail, myEventOption);
                }
            });
        },
        modalShow() {
            this.setData({
                authorIsShow: true
            });
        },
        loginCancel() {
            this.setData({
                authorIsShow: false
            });
        }
    },
    lifetimes: {
        ready: function() {
            let that = this;
            that.setData({
                domain: app.globalData.domain.slice(0, -10)
            });
        }
    }
});